package com.zgtp.controller;

import com.zgtp.service.DataBaseService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author e-fan.yang12
 */
@RestController
@EnableAutoConfiguration
public class DataBaseController {
	
	@Autowired
	private DataBaseService dataBaseService;

	@RequestMapping("/select")
	public HashMap<String,String> select(@Param("siteCode") String siteCode){
		HashMap<String,String> resMap = new HashMap<>();
		resMap.put("db1",String.valueOf(dataBaseService.selectDb1(siteCode)));
		resMap.put("db2",String.valueOf(dataBaseService.selectDb2(siteCode)));
		return resMap;
	}

}
